import {  ipcMain } from 'electron'

import {login} from './model/SymUserModel'



const onLoginSuccess = (callback)=>{
    ipcMain.handle("onLoginSuccess",async (e,config)=>{
        const res = await login(config)
        return callback(res)
    })
}

const onLogout = (callback)=>{
    ipcMain.on("logout",(e,data)=>{
        callback(e,data)
    })
}

const winOperater =(callback)=>{
    ipcMain.on("winOperater",(e,data)=>{
        callback(e,data)
    })
}

export {
    onLoginSuccess,
    onLogout,
    winOperater
}